<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<div th:replace="include/header::head"></div>

<div th:replace="include/manager_header::navbar(${loginManager})"></div>

<div class="container">
	<h1>
		<img th:src="@{/static/img/exam-admin.png}" /> 系统管理
	</h1>
	<div th:if="${!application.init}" class="exam-alert">没有设置管理员帐号，默认管理员帐号存在安全风险，请尽快处理！</div>
	<br />
	<div class="exam-form form-inline" >
		<h4>添加教师</h4>
		<input type="text" id="teacherName" name="name" placeholder="用户名*" size="20" />
		<input type="text" id="teacherPass" name="pass" placeholder="初始口令*" size="20" />
		<input type="text" id="teacherFullName" name="fullname" placeholder="真实姓名" size="20" />
		<input type="checkbox" id="isAdmin" name="admin" value="true"/> 管理员&nbsp;
		<button type="submit" id="addTeacher" name="action" class="btn btn-primary">添加</button>
	</div>

	<table class="table table-striped table-bordered">
		<thead>
			<tr>
				<th class="span4">用户名</th>
				<th class="span4">全名</th>
				<th class="span3">是否管理员</th>
				<th>&nbsp;</th>
			</tr>
		</thead>
		<tbody th:each="teacher : ${teacherList}">
			<tr>
				<td th:text="${teacher.name}"></td>
				<td th:text="${teacher.fullName}"></td>
				<td><i th:if="${teacher.isAdmin}" class="icon-ok"></i></td>
				<td>
					<a th:href="@{'/admin/teacher/edit/' + ${teacher.id}}"><i class="icon-edit" title="编辑" ></i></a>&nbsp;
					<a id="deleteTeacher" th:href="@{'/admin/teacher/delete/' + ${teacher.id}}"><i class="icon-trash" title="删除" ></i></a>
				</td>
			</tr>
		</tbody>
	</table>
</div>
<div th:replace="include/manager_footer::footer"></div>
